package cn.edu.xmu.javaee.chapter2.beanlifecycle.bean;

import java.util.Locale;

import lombok.extern.slf4j.Slf4j;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.MessageSource;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;


@Component
@Scope(value = "singleton")
@Slf4j
public class AliPayAdaptor implements PayAdaptor {

    private final MessageSource messageSource;

    public AliPayAdaptor(MessageSource messageSource) {
        this.messageSource = messageSource;
        log.info(messageSource.getMessage("constructor", new Object[] {"AlipayAdaptor"}, "property constructor not exist", Locale.ENGLISH));
    }

    @Override
    public String toString() {
        return "AliPayAdaptor{}";
    }
}
